import RescacheMgr from "../framework/inc/rescachemgr";
import ViewBase from "./viewbase";
import StagerMgr from "./../framework/inc/stagemgr";
import PhyWorld from "./fight/phyworld";
import { TweenMax } from "gsap";

export default class ViewTest extends ViewBase {
    constructor() {
        super("viewtest");
        this.initGraph();
        // this.runAction();
    }

    initGraph() {
        let sp = d.sp("ui_end").pos(0, 0);
        this.add(sp);

        let button = d.button("ui_logo").pos(d.w /2 , d.h / 2);
        button.setTap(()=>{
            StagerMgr.getInstance().clearView();
            PhyWorld.getWorld().startRunning();
        })
        this.add(button);
    }

    runAction() {
        TweenMax.to
            (
                this._sp.scale,
                1,
                {
                    x: 1.5,
                    y: 1.5,
                    z: 1.5,
                    repeat: -1,
                    yoyo: true
                },

            )
    }
}